//
//  UICollectionView+lnExtension.m
//  ShiKe
//
//  Created by 陆宁 on 2017/11/16.
//  Copyright © 2017年 LN. All rights reserved.
//

#import "UICollectionView+LNExtension.h"

@implementation UICollectionView (LNExtension)
- (void)ln_registerCell:(Class)cls {
    
    [self ln_registerCell:cls forCellReuseIdentifier:NSStringFromClass(cls)];
}
- (void)ln_registerCell:(Class)cls forCellReuseIdentifier:(NSString *)reuseIdentifier
{
    [self registerClass:cls forCellWithReuseIdentifier:reuseIdentifier];
}

- (void)ln_registerNibCell:(Class)cls {
    [self ln_registerNibCell:cls forCellReuseIdentifier:NSStringFromClass(cls)];
}
- (void)ln_registerNibCell:(Class)cls forCellReuseIdentifier:(NSString *)reuseIdentifier
{

    [self registerNib:[UINib nibWithNibName:NSStringFromClass(cls) bundle:nil] forCellWithReuseIdentifier:reuseIdentifier];
}

- (void)ln_registerCell:(Class)cls forSupplementaryViewOfKind:(NSString *)elementKind{
    
    [self registerClass:cls forSupplementaryViewOfKind:elementKind withReuseIdentifier:NSStringFromClass(cls)];
}
- (__kindof UICollectionReusableView *)ln_dequeueReusableWithHeadView:(Class)cls forIndexPath:(NSIndexPath *)indexPath{
    
   return [self dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass(cls) forIndexPath:indexPath];
}

- (__kindof UICollectionReusableView *)ln_dequeueReusableWithFooterViewView:(Class)cls forIndexPath:(NSIndexPath *)indexPath{
    
   return [self dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:NSStringFromClass(cls) forIndexPath:indexPath];
}
@end
